using System;
using System.IO;

namespace Condenser {

	class condense {
		
		public static void Main(string[] args) {
			if(args.Length!=1) {
				Console.WriteLine("Please specify file to condense");
				return;
			}
			Condenser cond;
			string suffix=args[0].Substring(args[0].Length-2);
			if(suffix=="vb")
				cond=new VBCondenser();
			else if(suffix=="cs")
				cond=new CSCondenser();
			else {
				Console.WriteLine("Please provide a C# or VB source file");
				return;
			}
			StreamReader reader=new StreamReader(args[0]);
			string source=reader.ReadToEnd();
			string condensed=cond.Run(source);
			Console.WriteLine(condensed);
		}
	}

}